<?php
if (! defined('PHPMYADMIN')) { exit; } if ($cfg['SQLValidator']['use'] == TRUE) { require_once './libraries/sqlvalidator.class.php'; } function PMA_validateSQL($sql) { global $cfg; $str = ''; if ($cfg['SQLValidator']['use']) { if (isset($GLOBALS['sqlvalidator_error']) && $GLOBALS['sqlvalidator_error']) { $str = sprintf($GLOBALS['strValidatorError'], '<a href="./Documentation.html#faqsqlvalidator" target="documentation">', '</a>'); } else { $srv = new PMA_SQLValidator(); if ($cfg['SQLValidator']['username'] != '') { $srv->setCredentials($cfg['SQLValidator']['username'], $cfg['SQLValidator']['password']); } $srv->appendCallingProgram('phpMyAdmin', PMA_VERSION); $srv->setTargetDbms('MySQL', PMA_MYSQL_STR_VERSION); $srv->start(); $str = $srv->validationString($sql); } } return $str; } ?>
